#!/usr/bin/env python

import glib
#apt-get install python-gudev
import gudev
import pynotify
import sys
def callback(client, action, device, user_data):
	device_vendor = device.get_property("ID_VENDOR_ENC")
	device_model = device.get_property("ID_MODEL_ENC")
	print "vender: ",device_vendor
	print "model: ",device_model
	if action == "add":
		print 'add'
		if device_vendor == "Generic" :
			print "sd card"
	elif action == "remove":
		print 'remove'
client = gudev.Client(["usb/usb_device"])
client.connect("uevent", callback, None)
loop = glib.MainLoop()
loop.run()
									
